<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="培训情况" name="train">
        <train-info ref="trainInfo"/>
      </el-tab-pane>
      <el-tab-pane label="考核情况" name="check">
        <check-info ref="checkInfo"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import checkInfo from './checkInfo'
  import trainInfo from './trainInfo'

  export default {
    components: { checkInfo, trainInfo },
    data() {
      return {
        activeName: 'train'
      }
    },
    methods: {
      handleClick(tab, event) {
        if(this.activeName==='train'){
          this.$refs.trainInfo.init()
        }else{
          this.$refs.checkInfo.init()
        }

      }
    }
  }
</script>
